package org.chench.extra.logsift.service.impl;

import org.chench.extra.logsift.service.LogHandler;
import org.chench.extra.logsift.websocket.WebSocketSessionHandler;
import org.springframework.stereotype.Service;

import java.nio.file.Path;
import java.util.Map;

/**
 * 将日志信息通过WebSocket协议推送到Web前端
 * @author chench
 * @date 2025.05.24
 */
@Service
public class WebHandlerImpl implements LogHandler {
    @Override
    public void handleLog(String logAppName, Path filePath, Map<String, Object> logData, String line) {
        WebSocketSessionHandler.sendMessageSafely(line);
    }
}